/*
 * @Author: EltonLi lijiaming@uavi-tech.com
 * @Date: 2023-09-11 18:13:28
 * @LastEditors: LVGRAPE
 * @LastEditTime: 2025-03-14 16:45:12
 * @FilePath: \zino-fc-v4\applications\ZINO_FC_V4.0\attitude\attitude.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2023-09-11     UAVI02       the first version
 */
#ifndef __ATTITUDE_H__
#define __ATTITUDE_H__

#ifdef __cplusplus
extern "C"
{
#endif

#include "imu.h"
#include "fc_sensors.h"
#include "pid.h"
#include "usercmd.h"
#include "statecontrol.h"

    // extern pid_obj_t pidRatePitch;
    // extern pid_obj_t pidRateRoll;
    // extern pid_obj_t pidRateYaw;
    // extern pid_obj_t pidData[PID_ANGLE_PITCH];
    // extern pid_obj_t pidAngleRoll;
    // extern pid_obj_t pidData[PID_ANGLE_YAW];

    void attitudePidInit(float dt);
    void attitudeRatePID(attitude_t *attitudeRateExpect, fc_control_t *output, zdrone_state_t *state);
    void attitudeAnglePID(attitude_t *attitudeExpect, zdrone_state_t *state, attitude_t *attitudeRateExpect);
    void attitudeResetAllPID(void);

#ifdef __cplusplus
}
#endif

#endif /* APPLICATIONS_ZINO_FC_V4_0_ATITUDE_ATITUDE_H_ */
